<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of topographic_area
 *
 * @author wilavel
 */
class TopographicArea extends AppModel {

    //put your code here
    var $name = "TopographicArea";
    var $actsAs = array('Logable' => array(
            'userModel' => 'User',
            'userKey' => 'user_id',
            'change' => 'full', // options are 'list' or 'full'
            'description_ids' => TRUE // options are TRUE or FALSE
            ));
    var $belongsTo = Array('TopographicMap', 'AreaType');
    var $validate = array(
        'area_type_id' => array(
            'notEmpty' => array(
                'rule' => 'notEmpty',
                'message' => 'Este campo no puede estar en blanco'
            ),
        ),
        'magnitud' => array(
            'notEmpty' => array(
                'rule' => 'numeric',
                'message' => 'Solo valores numéricos'
            ),
        )
    );
    var $virtualFields = array('total' => 'SUM(TopographicArea.magnitud)');

}

?>
